//
// Created by LvenLiu on 2022/8/16.
//

#ifndef FFMPEGDEMO_VIDEOCHANNEL_H
#define FFMPEGDEMO_VIDEOCHANNEL_H

extern "C" {
#include <libswscale/swscale.h>// 视频格式转换
#include <libavutil/imgutils.h>
}

#include "BaseChannel.h"

// 数据解析后的回调
typedef void (*RenderCallback)(uint8_t *, int, int, int);

class VideoChannel : public BaseChannel {


private:
    RenderCallback renderCallback;

public:
    VideoChannel(int stream_index, AVCodecContext *context);

    void start();

    void stop();

    void packet_decode();

    void frame_play();

    void setRenderCallback(RenderCallback renderCallback);
};


#endif //FFMPEGDEMO_VIDEOCHANNEL_H
